package com.caterina.components;
import java.util.Collection;
import java.util.Locale;
import javax.swing.JComboBox;

import com.caterina.resources.CWords;
public class CComboBox extends JComboBox{
	public CComboBox(Enum<?>[] values){
		super(values);
		super.setLocale(Locale.ITALY);
	}
	public CComboBox(Collection<String> values){
		super(values.toArray());
	}
	public String getText(){
		try {return CWords.getWord(((Enum<?>)this.getSelectedItem()).name());
		} catch (Exception e) {return null;}
	}
	public String toString(){
		return this.getText();
	}
	private static final long serialVersionUID = 1L;
}
